package com.dy.design_pattern_study.factory_method.dome2.simple;

import com.dy.design_pattern_study.factory_method.dome2.LeiFeng;
import com.dy.design_pattern_study.factory_method.dome2.Student;
import com.dy.design_pattern_study.factory_method.dome2.Volunteer;
import com.sun.xml.internal.bind.v2.model.core.LeafInfo;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-03-22
 * @Content 学习雷锋的简单工厂模式
 */
public class SimpleFactory {
    public static LeiFeng createLeiFeng(String type) {
        LeiFeng result = null;
        switch (type) {
            case "学雷锋的学生":
                result = new Student();
                break;
            case "学雷锋的社区志愿者":
                result = new Volunteer();
                break;
        }
        return result;
    }
}
